package com.pphh.demo.provider;

import com.alibaba.csp.sentinel.init.InitExecutor;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

/**
 * A example shows how to control the speed of dubbo rpc calls by concurrent threads
 * this example make reference to sentinel's demo examples.
 * https://github.com/alibaba/Sentinel
 *
 * @author pphh
 * @date 2019/1/18
 */
public class ProviderBootstrap {

    public static void main(String[] args) throws IOException {
        // Users don't need to manually call this method.
        InitExecutor.doInit();

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(ProviderConfiguration.class);
        context.refresh();

        System.out.println("provider is running.");
        System.in.read();
    }

}
